﻿//fixed firebug to ie
if(window.console==undefined){
	console = {};
	console.debug = console.info = log = console.error = function(){
		alert(Array.prototype.join.call(arguments, "-----"));
	}
}
var init = function(){
	
	//init the mask window
	g("_maskTitleButtonMin").onclick = function(){
		alert("Min");
	}
	g("_maskTitleButtonMax").onclick = function(){
		alert("Max");
	}
	g("_maskTitleButtonClose").onclick = function(){
		gc('mask-container')[0].style.display="none";
	}
	gc("mask-title")[0].onmousemove = function(e){
		//alert(e.button);
	}
	
	var lis = g("buttonContainer").getElementsByTagName("li");
	lis[0].onclick = function(){
		gc('mask-container')[0].style.display="block";
	}
	
	Bean.dragble({dom:gc("mask-body")[0]});
}



function g(id){return document.getElementById(id);}
function gc(theClassName){
	if(document.getElementsByClassName){ //FF
		return document.getElementsByClassName(theClassName);
	}else{//IE
		var i=0, divs = gt("div"),res = [];
		for(var i=0; i<divs.length;i++){
			if(divs[i].className==theClassName){
				res.push(divs[i]);
			}
		}
		return res;
	}
}
function gt(tagName){return document.getElementsByTagName(tagName);}






///////////////////////////////////////////////////////////////////////////////

window.onload = init;